Introduction to Octave by Sandeep Nagar
Author:Sandeep Nagar
Language: eng
Format: epub
Publisher: Apress, Berkeley, CA
The randp() Function
This function returns a matrix with Poisson distributed random elements with a mean value parameter given by the first argument. For example, if first argument is 1, then random numbers within the Poisson distribution having a mean of 1 are produced.
1 >> randp(1)
2 ans = 2
3 >> randp(1)
4 ans = 0
5 >> randp(1)
6 ans = 0
7 >> randp(1)
8 ans = 2
9 >> randp(1)
10 ans = 0
11 >> randp(1)
12 ans = 1
13 >> randp(1)
14 ans = 3
On the other hand, a matrix can also be produced by giving dimensions of the matrix as other arguments. Arguments can be presented as numbers separated by commas or as an array having a description of dimensions.
1 >> randp(1,2,3) % mean=1, matrix of 2 rows and 3 columns
2 ans =
3
4 1 0 1
5 0 0 1
6
7 >> randp(1,2,3) % repeating the same command and getting a different set of numbers
8 ans =
9
10 1 3 1
11 1 1 2
12
13 >> randp(2,2,3) % mean=2, matrix of 2 rows and 3 columns
14 ans =
15
16 1 3 2
17 2 0 1
18
19 >> randp(2,2,3) % repeating the same command and getting a different set of numbers
20 ans =
21
22 3 0 0
23 2 3 0
24
25 >> randp(20,4,3) % mean=20, matrix of 4 rows and 3 columns
26 ans =
27
28 21 17 22
29 23 21 13
30 17 24 12
31 30 13 13
32
33 >> randp(20,4,3) % repeating the same commands and getting different set of numbers
34 ans =
35
36 25 29 27
37 28 11 20
38 17 22 36
39 21 16 18
40
41 >> randp(20,[4,3]) % Inputting matrix dimensions as an array (4 rows and 3 columns)
42 ans =
43
44 18 18 19
45 29 22 13
46 19 25 24
47 20 18 17
48
49 >> randp(20,[3,4]) %% Inputting matrix dimensions as an array (3 rows and 4 columns)
50 ans =
51
52 19 19 25 28
53 21 17 10 29
54 18 20 19 24
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Coding Theory | Localization |
Logic | Object-Oriented Design |
Performance Optimization | Quality Control |
Reengineering | Robohelp |
Software Development | Software Reuse |
Structured Design | Testing |
Tools | UML |
Deep Learning with Python by François Chollet(12571)
Hello! Python by Anthony Briggs(9916)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9796)
The Mikado Method by Ola Ellnestam Daniel Brolund(9779)
Dependency Injection in .NET by Mark Seemann(9340)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8300)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7763)
Grails in Action by Glen Smith Peter Ledbrook(7696)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7084)
Microservices with Go by Alexander Shuiskov(6854)
Practical Design Patterns for Java Developers by Miroslav Wengner(6772)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6711)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6417)
Angular Projects - Third Edition by Aristeidis Bampakos(6117)
The Art of Crafting User Stories by The Art of Crafting User Stories(5645)
NetSuite for Consultants - Second Edition by Peter Ries(5579)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5385)
Kotlin in Action by Dmitry Jemerov(5065)
